export default {
  getAllCart: (userid, scb, fcb) => {

  },
  checkout: (price, scb, fcb) => {
    fetch('/settle?' + 'price=' + price, {
      credentials: 'include',
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
      }
      }).then((res) => {
        return res.json()
      }).then((json) => {
        if (json) {
          scb()
        }
      })
  },
  addCart: (productid, scb, fcb) => {
    fetch('/addCard?productId='+productid, {
      credentials: 'include',
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
      }
      }).then((res) => {
        return res.json()
      }).then((json) => {
        if (json) {
          scb()
        }
      })
  }
}